package service.impl;

import java.util.ArrayList;
import java.util.List;

import dao.DishDao;
import dao.impl.DishDaoImpl;
import po.Dish;
import service.DishService;

public class DishServiceImpl implements DishService{

	@Override
	public List<Dish> Query() {
		DishDao dishDaoImpl = new DishDaoImpl();
		List<Dish> dishList = new ArrayList<Dish>();
		dishList = dishDaoImpl.queryDish();
		if(dishList != null){
			return dishList;
		}
		return null;
	}

	@Override
	public Dish QueryADish(int dId) {
		DishDao dishDao = new DishDaoImpl();
		Dish dish = dishDao.queryADish(dId);
		if(dish != null){
			return dish;
		}else{
			System.out.println("can not query this dish");
			return null;
		}
		
	}

}
